import request from "@/router/axios";

// =====================  dict  =====================
export const dict_page = (params) =>
  request({
    url: "api/sys/dict/page",
    method: "GET",
    params,
  });
export const dict_detail = (params) =>
  request({
    url: `api/sys/dict/${params}`,
    method: "GET",
  });
export const dict_add = (params) =>
  request({
    url: "api/sys/dict/add",
    method: "POST",
    data: params,
  });
export const dict_edit = (params) =>
  request({
    url: "api/sys/dict/edit",
    method: "POST",
    data: params,
  });
export const dict_delete = (params) =>
  request({
    url: "api/sys/dict/delete",
    method: "GET",
    params,
  });
export const dict_item_tree = (params) =>
  request({
    url: "api/sys/dict/item/tree",
    method: "GET",
    params,
  });
export const dict_item_list = (params) =>
  request({
    url: "api/sys/dict/item/list",
    method: "GET",
    params,
  });
export const dict_item_add = (params) =>
  request({
    url: "api/sys/dict/item/add",
    method: "POST",
    data: params,
  });
export const dict_item_edit = (params) =>
  request({
    url: "api/sys/dict/item/edit",
    method: "POST",
    data: params,
  });
export const dict_item_delete = (params) =>
  request({
    url: "api/sys/dict/item/delete",
    method: "GET",
    params,
  });

// =====================  template  =====================
export const template_page = (params) =>
  request({
    url: "api/sys/template/page",
    method: "GET",
    params,
  });
export const template_detail = (params) =>
  request({
    url: `api/sys/template/${params}`,
    method: "GET",
  });
export const template_add = (params) =>
  request({
    url: "api/sys/template/add",
    method: "POST",
    data: params,
  });
export const template_edit = (params) =>
  request({
    url: "api/sys/template/edit",
    method: "POST",
    data: params,
  });
export const template_delete = (params) =>
  request({
    url: "api/sys/template/delete",
    method: "GET",
    params,
  });

// =====================  channel  =====================
export const channel_page = (params) =>
  request({
    url: "api/sys/channel/page",
    method: "GET",
    params,
  });
export const channel_list = (params) =>
  request({
    url: "api/sys/channel/list",
    method: "GET",
    params,
  });
export const channel_detail = (params) =>
  request({
    url: `api/sys/channel/${params}`,
    method: "GET",
  });
export const channel_add = (params) =>
  request({
    url: "api/sys/channel/add",
    method: "POST",
    data: params,
  });
export const channel_edit = (params) =>
  request({
    url: "api/sys/channel/edit",
    method: "POST",
    data: params,
  });
export const channel_delete = (params) =>
  request({
    url: "api/sys/channel/delete",
    method: "GET",
    params,
  });
export const channelMenu_tree = (params) =>
  request({
    url: "api/sys/channelMenu/tree",
    method: "GET",
    params,
  });

export const channelMenu_add = (params) =>
  request({
    url: "api/sys/channelMenu/add",
    method: "POST",
    data: params,
  });

export const channelMenu_edit = (params) =>
  request({
    url: "api/sys/channelMenu/edit",
    method: "POST",
    data: params,
  });

// =====================  area  =====================
export const area_list = (params) =>
  request({
    url: "api/cms/area/list",
    method: "GET",
    params,
  });

export const area_tree = (params) =>
  request({
    url: "api/cms/area/tree",
    method: "GET",
    params,
  });

export const area_detail = (params) =>
  request({
    url: "api/cms/area/detail",
    method: "GET",
    params,
  });

export const area_edit = (params) =>
  request({
    url: "api/cms/area/edit",
    method: "POST",
    data: params,
  });

// =====================  config  =====================
export const config_page = (params) =>
  request({
    url: "api/sys/config/page",
    method: "GET",
    params,
  });

export const config_add = (params) =>
  request({
    url: "api/sys/config/add",
    method: "POST",
    data: params,
  });

export const config_edit = (params) =>
  request({
    url: "api/sys/config/edit",
    method: "POST",
    data: params,
  });

export const config_delete = (params) =>
  request({
    url: "api/sys/config/delete",
    method: "GET",
    params,
  });

export const config_app = (params) =>
  request({
    url: "api/sys/config/app",
    method: "GET",
    params,
  });

// =====================  oss  =====================
export const ossChannel_page = (params) =>
  request({
    url: "api/oss/channel/page",
    method: "GET",
    params,
  });

export const ossChannel_add = (params) =>
  request({
    url: "api/oss/channel/add",
    method: "POST",
    data: params,
  });

export const ossChannel_edit = (params) =>
  request({
    url: "api/oss/channel/edit",
    method: "POST",
    data: params,
  });

export const ossChannel_delete = (params) =>
  request({
    url: "api/oss/channel/delete",
    method: "GET",
    params,
  });
